﻿
<%@page isELIgnored="false" pageEncoding="UTF-8" contentType="text/html; UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>持名法州主页</title>
 <link rel="stylesheet" href="${pageContext.request.contextPath}/themes/icon.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/themes/default/easyui.css">
 <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min1.3.5.js"></script>
 <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.easyui.min1.3.5.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js"></script>


<script type="text/javascript">
	<!--菜单处理-->
    $(function () {
        $("#gridtable").datagrid({
            title:'图片展示列表',
            url:'${pageContext.request.contextPath}/Log/selectLog',
            pagination:'true',
            fit:'true',
            columns:[[
                //增加复选框；
                {checkbox:true},
                //展示图片信息；
                {title:'日志ID值',field:'logId'},
                {title:'管理员名称',field:'adminUserName'},
                {title:'访问时间',field:'logDate'},
                {title:'管理员名称',field:'adminUserName'},
                {title:'访问内容',field:'logContent'},
                {title:'管理员所属IP值',field:'logIp'},
            ]],
            toolbar:"#toolsbut"
        })
    })
    function dele() {
        //获取标签元素加控件名称，调用相应的方法，获取所有的选中的id值；
        var AllIds=$("#gridtable").datagrid("getSelections")
        //判断所获中的id值是否为空进行判断；
        if(AllIds.length==0){
            alert("请选择中要删除的数据！！")
        }
        //创建新的数组；
        var ids=new Array(AllIds.length);
        alert(ids)
        //在遍历的时候进行赋值给新建的数组，然后进行传递给后台进行操作数据库；
        for(var i=0;i<ids.length;i++){
            ids[i]=AllIds[i].logId;
        }
        alert(ids);
        //发送ajax请求
        $.ajax({
            url:"${pageContext.request.contextPath}/Log/deleteOne",
            data:"ids="+ids,
        })
        $("#gridtable").datagrid("reload")
    }
</script>

</head>
<body>
<table id="gridtable">
</table>

<div id="toolsbut">
    <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-search'"></a>
    <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove'" onclick="dele()">批量删除</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="addbord()">添加</a>
</div>


</body>
</html>